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

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: H = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: E = None
        self.u: G = None
        self.q: H = None
        self.v: E = None
        self.s: G = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: C = None
        self.t: E = None
        self.r: H = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: E = None
        self.p: D = None
        self.u: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: H = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: E = None
        self.u: G = None
        self.q: H = None
        self.v: E = None
        self.s: G = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: C = None
        self.t: E = None
        self.r: H = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: E = None
        self.p: D = None
        self.u: A = None
        self.txt = txt

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

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