class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: D = None
        self.x: B = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: F = None
        self.z: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

l = A("l")
e = B("e")
h = C("h")
k = D("k")
j = E("j")
c = F("c")

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: F = None
        self.z: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

l = A("l")
e = B("e")
h = C("h")
k = D("k")
j = E("j")
c = F("c")

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