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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: D = None
        self.r: A = None
        self.o: A = None
        self.t: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.y: D = None
        self.r: A = None
        self.o: A = None
        self.t: B = None
        self.txt = txt

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

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

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