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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: A = None
        self.x: D = None
        self.t: D = None
        self.p: F = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.o: A = None
        self.p: F = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: B = None
        self.r: D = None
        self.q: C = None
        self.s: C = None
        self.t: B = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: C = None
        self.q: B = None
        self.v: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: A = None
        self.x: D = None
        self.t: D = None
        self.p: F = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.z: A = None
        self.o: A = None
        self.p: F = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: B = None
        self.r: D = None
        self.q: C = None
        self.s: C = None
        self.t: B = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: C = None
        self.q: B = None
        self.v: G = None
        self.txt = txt

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

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

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

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