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

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: B = None
        self.p: D = None
        self.txt = txt

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

c = A("c")
g = B("g")
l = C("l")
a = D("a")
n = E("n")
m = C("m")
j = D("j")
f = B("f")

c.s = l
c.u = n
c.x = g
c.y = a
c.z = f
g.q = a
g.w = n
g.s = n
g.t = c
g.p = c
l.q = n
l.t = f
l.x = c
a.y = n
a.x = g
a.p = j
n.t = m
m.q = n
m.t = g
m.x = c
j.y = n
j.x = g
j.p = a
f.q = a
f.w = n
f.s = n
f.t = c
f.p = c
assert l.x.s.q.t.t.q.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: E = None
        self.x: B = None
        self.y: D = None
        self.z: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: B = None
        self.p: D = None
        self.txt = txt

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

c = A("c")
g = B("g")
l = C("l")
a = D("a")
n = E("n")
m = C("m")
j = D("j")
f = B("f")

c.s = l
c.u = n
c.x = g
c.y = a
c.z = f
g.q = a
g.w = n
g.s = n
g.t = c
g.p = c
l.q = n
l.t = f
l.x = c
a.y = n
a.x = g
a.p = j
n.t = m
m.q = n
m.t = g
m.x = c
j.y = n
j.x = g
j.p = a
f.q = a
f.w = n
f.s = n
f.t = c
f.p = c
assert l.x.s.q.t.t.q.p.txt == "j"