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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: G = None
        self.u: D = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: G = None
        self.u: D = None
        self.o: F = None
        self.txt = txt

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

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

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