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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: E = None
        self.r: B = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: B = None
        self.r: B = None
        self.z: D = None
        self.q: D = None
        self.txt = txt

i = A("i")
f = B("f")
a = C("a")
e = D("e")
b = E("b")
g = B("g")
c = D("c")
n = E("n")

i.o = g
f.o = g
f.x = i
f.s = i
a.o = g
a.q = e
a.r = i
e.w = f
e.r = f
e.t = f
e.y = n
b.p = g
b.w = g
b.r = f
b.z = e
b.q = e
g.o = f
g.x = i
g.s = i
c.w = f
c.y = b
c.r = g
c.t = g
n.p = f
n.w = f
n.r = g
n.z = c
n.q = c
assert b.r.o.o.o.o.x.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: E = None
        self.r: B = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: B = None
        self.r: B = None
        self.z: D = None
        self.q: D = None
        self.txt = txt

i = A("i")
f = B("f")
a = C("a")
e = D("e")
b = E("b")
g = B("g")
c = D("c")
n = E("n")

i.o = g
f.o = g
f.x = i
f.s = i
a.o = g
a.q = e
a.r = i
e.w = f
e.r = f
e.t = f
e.y = n
b.p = g
b.w = g
b.r = f
b.z = e
b.q = e
g.o = f
g.x = i
g.s = i
c.w = f
c.y = b
c.r = g
c.t = g
n.p = f
n.w = f
n.r = g
n.z = c
n.q = c
assert b.r.o.o.o.o.x.o.s.txt == "i"