class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: C = None
        self.z: D = None
        self.x: F = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: C = None
        self.z: D = None
        self.x: F = None
        self.v: F = None
        self.txt = txt

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

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

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