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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: H = None
        self.u: D = None
        self.s: G = None
        self.r: C = None
        self.y: B = None
        self.o: B = None
        self.t: B = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: F = None
        self.v: B = None
        self.z: A = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: F = None
        self.z: E = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: D = None
        self.p: A = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: B = None
        self.z: H = None
        self.r: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: H = None
        self.u: D = None
        self.s: G = None
        self.r: C = None
        self.y: B = None
        self.o: B = None
        self.t: B = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: F = None
        self.v: B = None
        self.z: A = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: F = None
        self.z: E = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: D = None
        self.p: A = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: A = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: B = None
        self.z: H = None
        self.r: D = None
        self.txt = txt

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

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