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

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: A = None
        self.y: B = None
        self.r: B = None
        self.t: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: A = None
        self.y: B = None
        self.r: B = None
        self.t: C = None
        self.txt = txt

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

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