class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

l.x = j
f.z = d
f.x = c
a.y = l
a.v = f
a.r = f
c.s = l
c.t = l
c.r = l
c.u = j
c.o = f
d.u = c
d.z = l
j.u = d
j.z = d
j.y = m
h.y = l
h.v = f
h.r = f
m.y = l
m.v = f
m.r = f
assert j.z.z.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

l.x = j
f.z = d
f.x = c
a.y = l
a.v = f
a.r = f
c.s = l
c.t = l
c.r = l
c.u = j
c.o = f
d.u = c
d.z = l
j.u = d
j.z = d
j.y = m
h.y = l
h.v = f
h.r = f
m.y = l
m.v = f
m.r = f
assert j.z.z.x.z.txt == "d"