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

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.q: D = None
        self.u: D = None
        self.p: C = None
        self.y: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: F = None
        self.s: H = None
        self.v: C = None
        self.r: H = None
        self.y: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: F = None
        self.x: E = None
        self.t: C = None
        self.z: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: I = None
        self.q: D = None
        self.u: D = None
        self.p: C = None
        self.y: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: F = None
        self.s: H = None
        self.v: C = None
        self.r: H = None
        self.y: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: F = None
        self.x: E = None
        self.t: C = None
        self.z: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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