class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: G = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: F = None
        self.r: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: G = None
        self.v: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: F = None
        self.r: A = None
        self.txt = txt

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

j.v = g
j.t = m
g.w = m
g.s = d
g.v = e
k.w = i
k.v = i
k.z = g
k.x = m
k.t = e
i.r = k
i.u = g
i.z = e
i.x = j
e.p = k
e.z = i
m.u = i
m.r = e
d.w = m
d.o = m
d.r = j
assert e.z.z.z.z.p.v.u.txt == "g"