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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: E = None
        self.txt = txt

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

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

l = A("l")
d = B("d")
m = C("m")
b = D("b")
e = E("e")
c = F("c")

l.w = c
l.s = b
l.q = b
l.r = b
l.t = b
l.z = e
d.x = e
m.t = e
m.z = d
m.r = d
m.w = b
m.s = c
b.p = m
b.v = e
e.r = c
e.x = c
e.s = m
c.s = e
c.t = m
assert b.v.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: D = None
        self.q: D = None
        self.r: D = None
        self.t: D = None
        self.z: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: E = None
        self.txt = txt

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

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

l = A("l")
d = B("d")
m = C("m")
b = D("b")
e = E("e")
c = F("c")

l.w = c
l.s = b
l.q = b
l.r = b
l.t = b
l.z = e
d.x = e
m.t = e
m.z = d
m.r = d
m.w = b
m.s = c
b.p = m
b.v = e
e.r = c
e.x = c
e.s = m
c.s = e
c.t = m
assert b.v.r.t.txt == "m"