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

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

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

class D:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: D = None
        self.o: D = None
        self.u: C = None
        self.y: C = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: D = None
        self.o: D = None
        self.u: C = None
        self.y: C = None
        self.r: C = None
        self.txt = txt

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

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

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

n.p = f
n.y = f
n.q = c
c.u = h
c.x = e
c.o = f
c.r = f
c.s = g
b.o = l
g.z = a
g.v = a
g.o = a
g.u = b
g.r = b
g.y = l
h.o = e
h.p = e
f.p = n
f.q = n
f.v = e
l.o = b
a.z = g
a.v = g
a.o = g
a.u = l
a.r = l
a.y = b
e.p = f
e.y = f
e.q = c
m.o = n
m.p = e
assert b.o.o.o.o.o.o.txt == "b"