class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: E = None
        self.q: D = None
        self.txt = txt

j = A("j")
f = B("f")
m = C("m")
e = D("e")
c = E("c")
l = F("l")
g = G("g")
a = A("a")
k = D("k")

j.z = l
j.w = c
f.o = j
m.r = k
m.y = c
e.z = m
e.u = l
e.t = f
e.v = c
c.p = m
l.y = m
l.o = c
l.z = a
l.x = g
g.t = f
g.p = c
g.q = e
a.z = l
a.w = c
k.z = m
k.u = l
k.t = f
k.v = c
assert c.p.y.p.r.z.y.p.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: E = None
        self.q: D = None
        self.txt = txt

j = A("j")
f = B("f")
m = C("m")
e = D("e")
c = E("c")
l = F("l")
g = G("g")
a = A("a")
k = D("k")

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