class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: D = None
        self.x: B = None
        self.u: C = None
        self.w: E = None
        self.y: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: D = None
        self.t: F = None
        self.v: E = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: D = None
        self.s: B = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

b.z = c
b.r = a
b.x = h
b.u = l
b.w = j
b.y = d
h.o = b
h.x = j
l.v = b
d.z = c
d.t = c
d.y = c
d.o = a
d.v = j
j.u = c
j.q = d
j.s = h
j.z = a
c.v = h
a.z = c
a.t = c
a.y = c
a.o = d
a.v = j
assert b.r.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: D = None
        self.x: B = None
        self.u: C = None
        self.w: E = None
        self.y: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: D = None
        self.t: F = None
        self.v: E = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: D = None
        self.s: B = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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