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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: G = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: G = None
        self.x: G = None
        self.v: E = None
        self.txt = txt

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

i = A("i")
n = B("n")
f = C("f")
c = D("c")
e = E("e")
l = F("l")
j = G("j")

i.x = n
i.v = l
n.v = i
n.r = j
n.x = c
f.z = i
c.v = f
e.v = c
e.x = c
e.t = l
e.s = l
e.r = f
e.w = f
e.z = i
l.r = e
l.v = e
l.p = j
l.x = j
j.y = n
j.t = n
assert f.z.v.x.y.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: G = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: G = None
        self.x: G = None
        self.v: E = None
        self.txt = txt

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

i = A("i")
n = B("n")
f = C("f")
c = D("c")
e = E("e")
l = F("l")
j = G("j")

i.x = n
i.v = l
n.v = i
n.r = j
n.x = c
f.z = i
c.v = f
e.v = c
e.x = c
e.t = l
e.s = l
e.r = f
e.w = f
e.z = i
l.r = e
l.v = e
l.p = j
l.x = j
j.y = n
j.t = n
assert f.z.v.x.y.v.v.txt == "l"