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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: G = None
        self.y: F = None
        self.z: B = None
        self.v: A = None
        self.o: G = None
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: B = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: G = None
        self.y: F = None
        self.z: B = None
        self.v: A = None
        self.o: G = None
        self.p: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: B = None
        self.o: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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