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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: B = None
        self.x: F = None
        self.w: D = None
        self.p: D = None
        self.txt = txt

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

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

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

f = A("f")
h = B("h")
j = C("j")
e = D("e")
l = E("l")
i = F("i")
n = C("n")

f.w = e
f.z = e
f.t = e
f.r = l
h.q = i
j.s = i
j.x = i
j.o = h
j.w = e
j.p = e
e.s = i
e.v = i
e.w = i
e.y = i
e.t = l
l.t = j
l.v = n
l.y = i
i.o = f
i.r = n
n.s = i
n.x = i
n.o = h
n.w = e
n.p = e
assert l.v.x.o.w.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: E = None
        self.z: D = None
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.o: B = None
        self.x: F = None
        self.w: D = None
        self.p: D = None
        self.txt = txt

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

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

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

f = A("f")
h = B("h")
j = C("j")
e = D("e")
l = E("l")
i = F("i")
n = C("n")

f.w = e
f.z = e
f.t = e
f.r = l
h.q = i
j.s = i
j.x = i
j.o = h
j.w = e
j.p = e
e.s = i
e.v = i
e.w = i
e.y = i
e.t = l
l.t = j
l.v = n
l.y = i
i.o = f
i.r = n
n.s = i
n.x = i
n.o = h
n.w = e
n.p = e
assert l.v.x.o.w.t.txt == "l"