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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: G = None
        self.u: A = None
        self.s: G = None
        self.w: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: F = None
        self.s: C = None
        self.o: E = None
        self.w: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: G = None
        self.u: A = None
        self.s: G = None
        self.w: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: F = None
        self.s: C = None
        self.o: E = None
        self.w: C = None
        self.p: C = None
        self.txt = txt

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

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