class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: G = None
        self.u: C = None
        self.s: H = None
        self.o: H = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: B = None
        self.y: E = None
        self.u: A = None
        self.t: A = None
        self.s: D = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: H = None
        self.z: C = None
        self.y: F = None
        self.x: F = None
        self.u: G = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: G = None
        self.q: G = None
        self.w: C = None
        self.t: B = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: G = None
        self.q: D = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: E = None
        self.r: F = None
        self.p: B = None
        self.x: E = None
        self.w: F = None
        self.v: G = None
        self.s: E = None
        self.txt = txt

e = A("e")
g = B("g")
f = C("f")
n = D("n")
a = E("a")
h = F("h")
d = G("d")
c = H("c")
l = G("l")

e.q = a
g.t = f
g.u = f
g.w = d
g.s = c
g.o = c
g.v = e
f.r = e
f.u = e
f.t = e
f.p = g
f.y = a
f.s = n
f.z = d
n.p = c
n.r = c
n.z = f
n.t = f
n.y = h
n.x = h
n.u = d
a.u = g
a.t = g
a.y = l
a.q = l
a.w = f
a.s = d
h.v = n
h.q = n
h.x = d
h.o = c
d.y = e
d.w = c
c.o = f
c.t = a
c.x = a
c.s = a
c.r = h
c.w = h
c.p = g
c.v = d
l.y = e
l.w = c
assert f.r.q.q.w.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: G = None
        self.u: C = None
        self.s: H = None
        self.o: H = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: B = None
        self.y: E = None
        self.u: A = None
        self.t: A = None
        self.s: D = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: H = None
        self.z: C = None
        self.y: F = None
        self.x: F = None
        self.u: G = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: G = None
        self.q: G = None
        self.w: C = None
        self.t: B = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: G = None
        self.q: D = None
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: E = None
        self.r: F = None
        self.p: B = None
        self.x: E = None
        self.w: F = None
        self.v: G = None
        self.s: E = None
        self.txt = txt

e = A("e")
g = B("g")
f = C("f")
n = D("n")
a = E("a")
h = F("h")
d = G("d")
c = H("c")
l = G("l")

e.q = a
g.t = f
g.u = f
g.w = d
g.s = c
g.o = c
g.v = e
f.r = e
f.u = e
f.t = e
f.p = g
f.y = a
f.s = n
f.z = d
n.p = c
n.r = c
n.z = f
n.t = f
n.y = h
n.x = h
n.u = d
a.u = g
a.t = g
a.y = l
a.q = l
a.w = f
a.s = d
h.v = n
h.q = n
h.x = d
h.o = c
d.y = e
d.w = c
c.o = f
c.t = a
c.x = a
c.s = a
c.r = h
c.w = h
c.p = g
c.v = d
l.y = e
l.w = c
assert f.r.q.q.w.p.t.txt == "f"