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

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: D = None
        self.u: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: F = None
        self.z: A = None
        self.p: D = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: A = None
        self.o: A = None
        self.y: A = None
        self.z: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.x: D = None
        self.u: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: F = None
        self.z: A = None
        self.p: D = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: A = None
        self.o: A = None
        self.y: A = None
        self.z: E = None
        self.txt = txt

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

i.v = m
i.x = f
f.y = h
f.o = j
f.x = j
m.t = h
m.x = b
m.u = i
b.p = j
b.w = c
j.o = m
j.r = c
j.v = c
j.z = i
j.p = b
c.q = j
c.s = m
h.u = i
h.p = i
h.o = i
h.y = i
h.z = j
assert c.s.u.x.txt == "f"