class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: F = None
        self.u: G = None
        self.z: H = None
        self.y: E = None
        self.v: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: G = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: A = None
        self.r: B = None
        self.w: F = None
        self.txt = txt

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

i = A("i")
h = B("h")
j = C("j")
c = D("c")
d = E("d")
k = F("k")
a = G("a")
e = H("e")

i.p = j
i.q = k
i.u = a
i.z = e
i.v = e
i.y = d
h.u = a
j.x = i
c.p = e
c.u = k
d.v = i
k.v = i
k.u = a
k.p = j
a.q = j
a.z = i
a.r = h
a.w = k
e.s = c
e.p = k
assert i.q.p.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: F = None
        self.u: G = None
        self.z: H = None
        self.y: E = None
        self.v: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: G = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: A = None
        self.r: B = None
        self.w: F = None
        self.txt = txt

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

i = A("i")
h = B("h")
j = C("j")
c = D("c")
d = E("d")
k = F("k")
a = G("a")
e = H("e")

i.p = j
i.q = k
i.u = a
i.z = e
i.v = e
i.y = d
h.u = a
j.x = i
c.p = e
c.u = k
d.v = i
k.v = i
k.u = a
k.p = j
a.q = j
a.z = i
a.r = h
a.w = k
e.s = c
e.p = k
assert i.q.p.x.v.txt == "e"