class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: C = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: E = None
        self.u: E = None
        self.t: E = None
        self.x: C = None
        self.txt = txt

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

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

e = A("e")
j = B("j")
i = C("i")
k = D("k")
d = E("d")
c = F("c")

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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: E = None
        self.u: E = None
        self.t: E = None
        self.x: C = None
        self.txt = txt

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

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

e = A("e")
j = B("j")
i = C("i")
k = D("k")
d = E("d")
c = F("c")

e.t = i
e.r = i
e.s = c
j.o = i
j.y = i
j.x = c
j.u = c
j.q = k
j.t = k
i.o = d
k.q = c
k.s = d
k.u = d
k.t = d
k.x = i
d.v = i
d.u = e
d.q = k
c.w = k
assert c.w.x.o.v.o.txt == "d"