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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: C = None
        self.u: C = None
        self.p: A = None
        self.w: D = None
        self.o: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: E = None
        self.z: E = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: D = None
        self.q: F = None
        self.txt = txt

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

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

e = A("e")
d = B("d")
j = C("j")
f = D("f")
m = E("m")
i = F("i")
k = G("k")
h = G("h")

e.z = i
e.y = i
e.w = k
e.x = f
e.v = f
e.p = j
e.t = m
d.y = e
d.p = e
d.q = j
d.u = j
d.w = f
d.o = i
j.t = e
j.x = d
j.y = m
f.x = h
f.u = m
f.z = m
f.v = i
m.t = f
m.y = f
m.q = i
i.r = e
i.z = f
i.x = f
i.v = h
i.p = m
k.x = f
k.r = f
h.x = f
h.r = f
assert d.p.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: G = None
        self.x: D = None
        self.p: C = None
        self.y: F = None
        self.v: D = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: C = None
        self.u: C = None
        self.p: A = None
        self.w: D = None
        self.o: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: E = None
        self.z: E = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: D = None
        self.q: F = None
        self.txt = txt

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

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

e = A("e")
d = B("d")
j = C("j")
f = D("f")
m = E("m")
i = F("i")
k = G("k")
h = G("h")

e.z = i
e.y = i
e.w = k
e.x = f
e.v = f
e.p = j
e.t = m
d.y = e
d.p = e
d.q = j
d.u = j
d.w = f
d.o = i
j.t = e
j.x = d
j.y = m
f.x = h
f.u = m
f.z = m
f.v = i
m.t = f
m.y = f
m.q = i
i.r = e
i.z = f
i.x = f
i.v = h
i.p = m
k.x = f
k.r = f
h.x = f
h.r = f
assert d.p.t.q.txt == "i"