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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: A = None
        self.s: A = None
        self.y: B = None
        self.v: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: A = None
        self.s: A = None
        self.y: B = None
        self.v: B = None
        self.txt = txt

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

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