class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.t: C = None
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.q: H = None
        self.r: H = None
        self.p: F = None
        self.o: C = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: G = None
        self.u: H = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: D = None
        self.w: E = None
        self.v: D = None
        self.x: E = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: D = None
        self.r: C = None
        self.v: B = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.q: H = None
        self.r: H = None
        self.p: F = None
        self.o: C = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: G = None
        self.u: H = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: D = None
        self.w: E = None
        self.v: D = None
        self.x: E = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: D = None
        self.r: C = None
        self.v: B = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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