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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

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

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