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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: D = None
        self.q: B = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: D = None
        self.q: B = None
        self.x: A = None
        self.txt = txt

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

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

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