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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: F = None
        self.o: A = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: F = None
        self.o: A = None
        self.r: C = None
        self.txt = txt

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

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

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

j.p = c
j.r = h
j.s = b
j.o = g
d.q = m
d.y = b
m.y = l
m.s = e
m.p = d
m.z = h
g.u = b
g.z = c
g.o = h
g.r = m
e.s = m
e.p = g
e.y = b
c.r = e
c.u = m
c.q = g
c.w = d
b.q = m
b.y = d
h.p = c
h.r = j
h.s = d
h.o = g
f.r = e
f.u = m
f.q = g
f.w = d
l.r = e
l.u = m
l.q = g
l.w = d
assert b.q.p.q.s.y.y.q.s.s.txt == "m"