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

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: I = None
        self.x: D = None
        self.v: E = None
        self.o: C = None
        self.y: G = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: C = None
        self.p: E = None
        self.t: H = None
        self.s: B = None
        self.y: F = None
        self.q: H = None
        self.u: C = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

b = A("b")
n = B("n")
g = C("g")
d = D("d")
c = E("c")
h = F("h")
a = G("a")
i = H("i")
l = I("l")
m = H("m")

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

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: I = None
        self.x: D = None
        self.v: E = None
        self.o: C = None
        self.y: G = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: C = None
        self.p: E = None
        self.t: H = None
        self.s: B = None
        self.y: F = None
        self.q: H = None
        self.u: C = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

b = A("b")
n = B("n")
g = C("g")
d = D("d")
c = E("c")
h = F("h")
a = G("a")
i = H("i")
l = I("l")
m = H("m")

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