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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: E = None
        self.x: E = None
        self.r: E = None
        self.v: F = None
        self.p: C = None
        self.txt = txt

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

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

j = A("j")
e = B("e")
c = C("c")
h = D("h")
n = E("n")
d = F("d")

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: E = None
        self.x: E = None
        self.r: E = None
        self.v: F = None
        self.p: C = None
        self.txt = txt

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

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

j = A("j")
e = B("e")
c = C("c")
h = D("h")
n = E("n")
d = F("d")

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