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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: C = None
        self.w: D = None
        self.q: C = None
        self.txt = txt

a = A("a")
h = B("h")
c = C("c")
i = D("i")
f = E("f")
e = F("e")
l = G("l")
k = B("k")
b = F("b")

a.v = i
a.z = h
a.x = f
a.q = c
h.w = f
h.x = f
h.z = a
h.u = k
h.v = b
c.o = a
i.p = f
i.r = f
i.v = l
i.w = b
f.u = b
f.v = h
f.s = c
e.r = l
l.z = a
l.s = c
l.q = c
l.w = i
k.w = f
k.x = f
k.z = a
k.u = h
k.v = e
b.r = l
assert i.w.r.q.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.z: B = None
        self.x: E = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: C = None
        self.w: D = None
        self.q: C = None
        self.txt = txt

a = A("a")
h = B("h")
c = C("c")
i = D("i")
f = E("f")
e = F("e")
l = G("l")
k = B("k")
b = F("b")

a.v = i
a.z = h
a.x = f
a.q = c
h.w = f
h.x = f
h.z = a
h.u = k
h.v = b
c.o = a
i.p = f
i.r = f
i.v = l
i.w = b
f.u = b
f.v = h
f.s = c
e.r = l
l.z = a
l.s = c
l.q = c
l.w = i
k.w = f
k.x = f
k.z = a
k.u = h
k.v = e
b.r = l
assert i.w.r.q.o.x.txt == "f"