class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: F = None
        self.z: B = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: E = None
        self.r: A = None
        self.z: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: C = None
        self.w: E = None
        self.y: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: C = None
        self.z: A = None
        self.o: D = None
        self.w: E = None
        self.r: F = None
        self.v: A = None
        self.txt = txt

g = A("g")
n = B("n")
j = C("j")
d = D("d")
a = E("a")
c = F("c")
f = G("f")

g.y = j
g.u = j
g.q = c
g.z = n
n.v = a
n.y = a
n.r = g
n.z = g
j.z = a
j.o = f
j.v = f
j.w = n
j.x = n
j.u = g
j.t = g
d.u = c
d.x = j
d.w = a
d.y = n
a.y = n
a.o = c
a.s = j
c.q = j
c.t = f
f.s = n
f.x = j
f.z = g
f.v = g
f.o = d
f.w = a
f.r = c
assert f.r.t.o.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: F = None
        self.z: B = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: E = None
        self.r: A = None
        self.z: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: C = None
        self.w: E = None
        self.y: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: C = None
        self.z: A = None
        self.o: D = None
        self.w: E = None
        self.r: F = None
        self.v: A = None
        self.txt = txt

g = A("g")
n = B("n")
j = C("j")
d = D("d")
a = E("a")
c = F("c")
f = G("f")

g.y = j
g.u = j
g.q = c
g.z = n
n.v = a
n.y = a
n.r = g
n.z = g
j.z = a
j.o = f
j.v = f
j.w = n
j.x = n
j.u = g
j.t = g
d.u = c
d.x = j
d.w = a
d.y = n
a.y = n
a.o = c
a.s = j
c.q = j
c.t = f
f.s = n
f.x = j
f.z = g
f.v = g
f.o = d
f.w = a
f.r = c
assert f.r.t.o.x.v.txt == "f"