class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: E = None
        self.x: C = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: E = None
        self.v: F = None
        self.t: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: E = None
        self.x: C = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: E = None
        self.v: F = None
        self.t: F = None
        self.txt = txt

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

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

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

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