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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

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

l = A("l")
m = B("m")
k = C("k")
d = D("d")
a = E("a")
b = F("b")

l.y = a
l.t = a
m.v = a
k.r = m
d.z = b
d.q = a
d.s = k
d.w = l
a.w = b
b.p = k
b.s = k
b.t = k
b.u = a
b.x = a
assert d.z.x.w.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

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

l = A("l")
m = B("m")
k = C("k")
d = D("d")
a = E("a")
b = F("b")

l.y = a
l.t = a
m.v = a
k.r = m
d.z = b
d.q = a
d.s = k
d.w = l
a.w = b
b.p = k
b.s = k
b.t = k
b.u = a
b.x = a
assert d.z.x.w.x.w.txt == "b"