class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: A = None
        self.y: D = None
        self.o: A = None
        self.r: D = None
        self.q: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: E = None
        self.w: D = None
        self.s: A = None
        self.z: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: E = None
        self.w: D = None
        self.s: A = None
        self.z: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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