class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: D = None
        self.t: C = None
        self.r: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: E = None
        self.txt = txt

e = A("e")
b = B("b")
m = C("m")
h = D("h")
f = E("f")
k = F("k")
j = G("j")

e.v = b
e.s = h
e.t = m
e.r = m
b.z = f
b.p = h
b.u = j
m.w = k
h.r = m
f.u = e
k.o = h
k.r = m
j.x = b
j.z = f
assert f.u.s.r.w.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: D = None
        self.t: C = None
        self.r: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: E = None
        self.txt = txt

e = A("e")
b = B("b")
m = C("m")
h = D("h")
f = E("f")
k = F("k")
j = G("j")

e.v = b
e.s = h
e.t = m
e.r = m
b.z = f
b.p = h
b.u = j
m.w = k
h.r = m
f.u = e
k.o = h
k.r = m
j.x = b
j.z = f
assert f.u.s.r.w.o.r.txt == "m"