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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: B = None
        self.w: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: B = None
        self.w: B = None
        self.txt = txt

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

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

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

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