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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

m.w = d
m.q = d
m.x = k
m.v = e
m.r = n
b.o = h
b.v = h
l.r = h
l.z = d
k.u = m
d.x = n
d.y = l
e.v = d
e.p = d
n.v = d
n.p = d
h.o = b
h.v = b
assert k.u.q.x.p.x.v.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: D = None
        self.q: E = None
        self.v: F = None
        self.r: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

m.w = d
m.q = d
m.x = k
m.v = e
m.r = n
b.o = h
b.v = h
l.r = h
l.z = d
k.u = m
d.x = n
d.y = l
e.v = d
e.p = d
n.v = d
n.p = d
h.o = b
h.v = b
assert k.u.q.x.p.x.v.x.v.txt == "d"