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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: F = None
        self.x: C = None
        self.o: E = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: E = None
        self.u: B = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: A = None
        self.p: A = None
        self.t: E = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: C = None
        self.s: E = None
        self.o: D = None
        self.txt = txt

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

l.p = d
h.p = b
h.w = g
h.x = d
h.u = d
h.o = e
d.p = h
d.x = b
m.w = d
m.v = e
m.y = e
m.u = h
e.y = d
e.q = d
e.s = l
e.p = l
e.t = i
g.v = d
g.y = d
g.s = e
g.o = b
f.w = d
f.v = i
f.y = i
f.u = h
i.y = d
i.q = d
i.s = n
i.p = l
i.t = e
n.p = d
b.w = d
b.v = e
b.y = e
b.u = h
assert l.p.p.x.x.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: F = None
        self.x: C = None
        self.o: E = None
        self.u: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: E = None
        self.u: B = None
        self.y: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: A = None
        self.p: A = None
        self.t: E = None
        self.q: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: C = None
        self.s: E = None
        self.o: D = None
        self.txt = txt

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

l.p = d
h.p = b
h.w = g
h.x = d
h.u = d
h.o = e
d.p = h
d.x = b
m.w = d
m.v = e
m.y = e
m.u = h
e.y = d
e.q = d
e.s = l
e.p = l
e.t = i
g.v = d
g.y = d
g.s = e
g.o = b
f.w = d
f.v = i
f.y = i
f.u = h
i.y = d
i.q = d
i.s = n
i.p = l
i.t = e
n.p = d
b.w = d
b.v = e
b.y = e
b.u = h
assert l.p.p.x.x.w.x.txt == "b"