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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: B = None
        self.txt = txt

j = A("j")
n = B("n")
a = C("a")
h = D("h")
k = E("k")
g = D("g")
f = E("f")
d = B("d")
b = B("b")

j.q = a
j.p = d
j.t = n
n.y = a
n.s = a
a.y = j
a.q = g
h.o = b
k.z = j
k.v = n
g.o = n
f.z = j
f.v = b
d.y = a
d.s = a
b.y = a
b.s = a
assert a.q.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: B = None
        self.t: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: B = None
        self.txt = txt

j = A("j")
n = B("n")
a = C("a")
h = D("h")
k = E("k")
g = D("g")
f = E("f")
d = B("d")
b = B("b")

j.q = a
j.p = d
j.t = n
n.y = a
n.s = a
a.y = j
a.q = g
h.o = b
k.z = j
k.v = n
g.o = n
f.z = j
f.v = b
d.y = a
d.s = a
b.y = a
b.s = a
assert a.q.o.y.txt == "a"