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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: G = None
        self.u: E = None
        self.v: E = None
        self.q: A = None
        self.w: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: B = None
        self.z: B = None
        self.s: F = None
        self.u: F = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: E = None
        self.o: G = None
        self.t: A = None
        self.v: C = None
        self.y: E = None
        self.p: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: G = None
        self.u: E = None
        self.v: E = None
        self.q: A = None
        self.w: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: B = None
        self.z: B = None
        self.s: F = None
        self.u: F = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: E = None
        self.o: G = None
        self.t: A = None
        self.v: C = None
        self.y: E = None
        self.p: A = None
        self.txt = txt

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

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