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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: D = None
        self.u: B = None
        self.y: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: A = None
        self.p: E = None
        self.r: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: D = None
        self.u: B = None
        self.y: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: A = None
        self.p: E = None
        self.r: D = None
        self.txt = txt

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

k.z = n
g.x = f
g.y = f
g.s = n
g.u = d
b.p = g
b.y = h
b.v = d
n.p = h
n.q = f
l.q = g
f.y = d
f.o = k
f.p = j
f.r = m
h.p = g
h.v = g
h.y = b
m.p = b
m.q = f
j.q = g
d.x = f
d.y = f
d.s = n
d.u = g
assert m.p.v.u.u.s.p.txt == "h"