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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: H = None
        self.z: G = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: B = None
        self.s: C = None
        self.p: C = None
        self.w: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: H = None
        self.z: G = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: B = None
        self.s: C = None
        self.p: C = None
        self.w: A = None
        self.txt = txt

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

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