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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: A = None
        self.z: A = None
        self.q: B = None
        self.y: D = None
        self.u: F = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: C = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: A = None
        self.z: A = None
        self.q: B = None
        self.y: D = None
        self.u: F = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: C = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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