class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: D = None
        self.r: F = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: C = None
        self.p: F = None
        self.v: C = None
        self.txt = txt

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

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

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

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

d = A("d")
l = B("l")
f = C("f")
h = D("h")
m = E("m")
i = F("i")
b = F("b")
j = C("j")

d.w = b
d.r = b
d.z = h
d.p = f
l.q = d
l.r = j
l.p = b
l.v = f
f.v = l
f.t = l
f.q = l
h.o = d
h.s = f
m.z = j
i.q = h
i.s = h
i.u = h
i.r = f
i.x = b
b.q = h
b.s = h
b.u = h
b.r = j
b.x = i
j.v = l
j.t = l
j.q = l
assert l.p.x.s.s.v.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: D = None
        self.r: F = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.r: C = None
        self.p: F = None
        self.v: C = None
        self.txt = txt

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

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

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

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

d = A("d")
l = B("l")
f = C("f")
h = D("h")
m = E("m")
i = F("i")
b = F("b")
j = C("j")

d.w = b
d.r = b
d.z = h
d.p = f
l.q = d
l.r = j
l.p = b
l.v = f
f.v = l
f.t = l
f.q = l
h.o = d
h.s = f
m.z = j
i.q = h
i.s = h
i.u = h
i.r = f
i.x = b
b.q = h
b.s = h
b.u = h
b.r = j
b.x = i
j.v = l
j.t = l
j.q = l
assert l.p.x.s.s.v.q.p.txt == "f"