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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: F = None
        self.t: A = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: F = None
        self.t: A = None
        self.q: B = None
        self.txt = txt

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

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