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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: D = None
        self.o: E = None
        self.q: A = None
        self.t: B = None
        self.z: C = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: C = None
        self.y: C = None
        self.t: F = None
        self.u: C = None
        self.o: F = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: D = None
        self.o: E = None
        self.q: A = None
        self.t: B = None
        self.z: C = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: C = None
        self.y: C = None
        self.t: F = None
        self.u: C = None
        self.o: F = None
        self.p: D = None
        self.txt = txt

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

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