class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: G = None
        self.o: D = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: C = None
        self.y: C = None
        self.s: B = None
        self.o: E = None
        self.u: B = None
        self.p: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: C = None
        self.s: H = None
        self.r: A = None
        self.y: A = None
        self.p: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: D = None
        self.u: B = None
        self.x: D = None
        self.y: A = None
        self.q: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: C = None
        self.y: C = None
        self.s: B = None
        self.o: E = None
        self.u: B = None
        self.p: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: C = None
        self.s: H = None
        self.r: A = None
        self.y: A = None
        self.p: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: D = None
        self.u: B = None
        self.x: D = None
        self.y: A = None
        self.q: D = None
        self.txt = txt

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

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