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

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

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

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

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

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

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

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

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

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

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

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

j.q = c
b.w = j
b.q = c
b.o = i
n.t = j
n.u = j
n.x = b
g.y = l
g.o = l
g.w = l
g.s = f
g.p = k
k.t = g
l.y = g
l.o = g
l.w = g
l.s = f
l.p = k
i.w = j
i.q = c
i.o = b
d.t = j
d.x = b
d.u = f
c.t = l
f.q = k
assert c.t.w.o.p.t.txt == "g"