class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: C = None
        self.r: D = None
        self.t: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: C = None
        self.q: E = None
        self.v: B = None
        self.txt = txt

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

g = A("g")
m = B("m")
k = C("k")
e = D("e")
c = E("c")
f = B("f")
j = C("j")

g.u = c
g.p = k
g.r = e
g.t = j
m.s = g
m.w = c
m.u = c
m.p = c
m.t = e
k.q = j
k.y = j
e.r = g
e.u = j
e.q = c
e.v = m
c.q = f
c.v = f
c.p = g
f.s = g
f.w = c
f.u = c
f.p = c
f.t = e
j.q = k
j.y = k
assert f.t.q.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: C = None
        self.r: D = None
        self.t: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: C = None
        self.q: E = None
        self.v: B = None
        self.txt = txt

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

g = A("g")
m = B("m")
k = C("k")
e = D("e")
c = E("c")
f = B("f")
j = C("j")

g.u = c
g.p = k
g.r = e
g.t = j
m.s = g
m.w = c
m.u = c
m.p = c
m.t = e
k.q = j
k.y = j
e.r = g
e.u = j
e.q = c
e.v = m
c.q = f
c.v = f
c.p = g
f.s = g
f.w = c
f.u = c
f.p = c
f.t = e
j.q = k
j.y = k
assert f.t.q.v.s.txt == "g"