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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: H = None
        self.z: F = None
        self.r: C = None
        self.t: B = None
        self.x: C = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: B = None
        self.q: F = None
        self.r: D = None
        self.w: B = None
        self.y: G = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: B = None
        self.y: D = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: H = None
        self.s: A = None
        self.o: A = None
        self.txt = txt

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

e = A("e")
f = B("f")
i = C("i")
a = D("a")
d = E("d")
m = F("m")
n = G("n")
c = H("c")

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: H = None
        self.z: F = None
        self.r: C = None
        self.t: B = None
        self.x: C = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: B = None
        self.q: F = None
        self.r: D = None
        self.w: B = None
        self.y: G = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: B = None
        self.y: D = None
        self.x: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: H = None
        self.s: A = None
        self.o: A = None
        self.txt = txt

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

e = A("e")
f = B("f")
i = C("i")
a = D("a")
d = E("d")
m = F("m")
n = G("n")
c = H("c")

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