class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: F = None
        self.u: C = None
        self.o: H = None
        self.r: G = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: C = None
        self.v: C = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: E = None
        self.y: F = None
        self.o: G = None
        self.u: H = None
        self.r: H = None
        self.x: E = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: C = None
        self.v: C = None
        self.w: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: E = None
        self.y: F = None
        self.o: G = None
        self.u: H = None
        self.r: H = None
        self.x: E = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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