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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

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

e = A("e")
d = B("d")
l = C("l")
i = D("i")
k = E("k")
h = F("h")

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

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

e = A("e")
d = B("d")
l = C("l")
i = D("i")
k = E("k")
h = F("h")

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