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

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

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: A = None
        self.t: E = None
        self.y: B = None
        self.txt = txt

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

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

d = A("d")
b = B("b")
m = C("m")
j = D("j")
c = E("c")
i = C("i")
n = E("n")
g = B("g")

d.o = n
d.y = j
d.r = j
d.s = b
d.u = g
b.o = j
m.o = i
m.x = d
m.t = n
m.y = b
j.p = i
j.q = d
c.q = j
c.o = d
c.x = d
i.o = m
i.x = d
i.t = c
i.y = g
n.q = j
n.o = d
n.x = d
g.o = j
assert b.o.p.y.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: D = None
        self.r: D = None
        self.s: B = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: A = None
        self.t: E = None
        self.y: B = None
        self.txt = txt

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

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

d = A("d")
b = B("b")
m = C("m")
j = D("j")
c = E("c")
i = C("i")
n = E("n")
g = B("g")

d.o = n
d.y = j
d.r = j
d.s = b
d.u = g
b.o = j
m.o = i
m.x = d
m.t = n
m.y = b
j.p = i
j.q = d
c.q = j
c.o = d
c.x = d
i.o = m
i.x = d
i.t = c
i.y = g
n.q = j
n.o = d
n.x = d
g.o = j
assert b.o.p.y.o.p.txt == "i"