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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: D = None
        self.t: G = None
        self.o: G = None
        self.p: F = None
        self.v: E = None
        self.q: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: F = None
        self.txt = txt

a = A("a")
f = B("f")
l = C("l")
h = D("h")
j = E("j")
e = F("e")
d = G("d")

a.u = e
a.z = e
a.t = e
a.x = j
f.w = a
f.s = h
f.t = d
f.o = d
f.p = e
f.q = e
f.v = j
l.q = f
l.x = f
h.v = d
h.p = j
j.v = e
e.o = h
e.u = f
d.z = a
d.y = e
assert j.v.u.w.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: F = None
        self.t: F = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: D = None
        self.t: G = None
        self.o: G = None
        self.p: F = None
        self.v: E = None
        self.q: F = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: F = None
        self.txt = txt

a = A("a")
f = B("f")
l = C("l")
h = D("h")
j = E("j")
e = F("e")
d = G("d")

a.u = e
a.z = e
a.t = e
a.x = j
f.w = a
f.s = h
f.t = d
f.o = d
f.p = e
f.q = e
f.v = j
l.q = f
l.x = f
h.v = d
h.p = j
j.v = e
e.o = h
e.u = f
d.z = a
d.y = e
assert j.v.u.w.x.v.txt == "e"