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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: F = None
        self.p: D = None
        self.y: C = None
        self.u: C = None
        self.w: B = None
        self.txt = txt

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

c = A("c")
d = B("d")
k = C("k")
i = D("i")
l = E("l")
m = F("m")
b = B("b")
n = F("n")

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: F = None
        self.p: D = None
        self.y: C = None
        self.u: C = None
        self.w: B = None
        self.txt = txt

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

c = A("c")
d = B("d")
k = C("k")
i = D("i")
l = E("l")
m = F("m")
b = B("b")
n = F("n")

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