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

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: F = None
        self.z: A = None
        self.y: G = None
        self.r: A = None
        self.u: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: D = None
        self.v: G = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: F = None
        self.z: A = None
        self.y: G = None
        self.r: A = None
        self.u: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: D = None
        self.v: G = None
        self.z: B = None
        self.txt = txt

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

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

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