class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: G = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: C = None
        self.w: A = None
        self.y: G = None
        self.u: E = None
        self.t: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: G = None
        self.u: C = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: D = None
        self.r: F = None
        self.u: B = None
        self.txt = txt

n = A("n")
m = B("m")
c = C("c")
g = D("g")
a = E("a")
i = F("i")
j = G("j")
e = F("e")

n.u = j
n.p = j
n.s = i
m.u = c
m.s = c
m.z = n
m.x = n
m.v = a
m.q = a
m.y = j
c.r = g
g.o = i
g.q = c
g.w = n
g.y = j
g.u = a
g.t = m
a.p = m
a.s = m
a.y = g
a.q = n
i.o = a
i.w = j
i.u = c
i.q = g
j.o = m
j.u = m
j.y = g
j.r = i
e.o = a
e.w = j
e.u = c
e.q = g
assert e.u.r.o.q.u.y.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: G = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: C = None
        self.w: A = None
        self.y: G = None
        self.u: E = None
        self.t: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: G = None
        self.u: C = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: D = None
        self.r: F = None
        self.u: B = None
        self.txt = txt

n = A("n")
m = B("m")
c = C("c")
g = D("g")
a = E("a")
i = F("i")
j = G("j")
e = F("e")

n.u = j
n.p = j
n.s = i
m.u = c
m.s = c
m.z = n
m.x = n
m.v = a
m.q = a
m.y = j
c.r = g
g.o = i
g.q = c
g.w = n
g.y = j
g.u = a
g.t = m
a.p = m
a.s = m
a.y = g
a.q = n
i.o = a
i.w = j
i.u = c
i.q = g
j.o = m
j.u = m
j.y = g
j.r = i
e.o = a
e.w = j
e.u = c
e.q = g
assert e.u.r.o.q.u.y.w.u.txt == "j"