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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: G = None
        self.v: A = None
        self.t: G = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: B = None
        self.w: B = None
        self.t: A = None
        self.p: A = None
        self.o: G = None
        self.z: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: G = None
        self.v: A = None
        self.t: G = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: B = None
        self.w: B = None
        self.t: A = None
        self.p: A = None
        self.o: G = None
        self.z: F = None
        self.txt = txt

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

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