class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: C = None
        self.q: C = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: C = None
        self.z: F = None
        self.s: C = None
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: D = None
        self.s: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: A = None
        self.y: E = None
        self.txt = txt

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

e.x = c
e.z = i
e.q = i
e.s = k
f.q = c
f.t = i
f.z = g
i.s = n
i.p = g
m.o = k
m.z = k
m.t = i
m.s = i
m.u = c
n.t = i
k.r = m
k.p = m
k.s = i
c.o = i
c.q = e
g.z = m
g.r = e
g.y = n
assert e.x.o.p.r.x.o.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: C = None
        self.q: C = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: C = None
        self.z: F = None
        self.s: C = None
        self.u: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: D = None
        self.s: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: A = None
        self.y: E = None
        self.txt = txt

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

e.x = c
e.z = i
e.q = i
e.s = k
f.q = c
f.t = i
f.z = g
i.s = n
i.p = g
m.o = k
m.z = k
m.t = i
m.s = i
m.u = c
n.t = i
k.r = m
k.p = m
k.s = i
c.o = i
c.q = e
g.z = m
g.r = e
g.y = n
assert e.x.o.p.r.x.o.s.t.txt == "i"