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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: C = None
        self.q: F = None
        self.x: B = None
        self.t: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: F = None
        self.r: B = None
        self.v: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: C = None
        self.q: F = None
        self.x: B = None
        self.t: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: F = None
        self.r: B = None
        self.v: D = None
        self.txt = txt

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

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

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