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

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

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

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

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

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

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

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

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

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

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