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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: B = None
        self.q: D = None
        self.w: E = None
        self.u: E = None
        self.txt = txt

c = A("c")
b = B("b")
a = C("a")
j = D("j")
i = E("i")
k = E("k")
e = E("e")
g = A("g")

c.o = a
b.s = a
b.y = g
a.s = b
j.q = b
i.p = c
i.y = b
i.q = j
i.w = k
i.u = k
k.p = c
k.y = b
k.q = j
k.w = e
k.u = i
e.p = g
e.y = b
e.q = j
e.w = i
e.u = k
g.o = a
assert b.y.o.s.s.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: B = None
        self.q: D = None
        self.w: E = None
        self.u: E = None
        self.txt = txt

c = A("c")
b = B("b")
a = C("a")
j = D("j")
i = E("i")
k = E("k")
e = E("e")
g = A("g")

c.o = a
b.s = a
b.y = g
a.s = b
j.q = b
i.p = c
i.y = b
i.q = j
i.w = k
i.u = k
k.p = c
k.y = b
k.q = j
k.w = e
k.u = i
e.p = g
e.y = b
e.q = j
e.w = i
e.u = k
g.o = a
assert b.y.o.s.s.s.y.txt == "g"