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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: B = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: E = None
        self.u: H = None
        self.y: A = None
        self.x: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: G = None
        self.p: C = None
        self.v: E = None
        self.txt = txt

g = A("g")
d = B("d")
e = C("e")
k = D("k")
j = E("j")
f = F("f")
m = G("m")
l = H("l")

g.q = f
g.t = f
g.o = m
g.x = d
g.v = e
g.u = l
g.r = k
d.s = g
e.q = f
e.r = d
e.u = l
k.s = e
k.o = l
j.s = m
j.w = g
f.t = k
f.v = j
f.u = l
f.y = g
f.x = m
m.v = f
m.u = f
l.y = j
l.v = j
l.z = m
l.p = e
assert k.o.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: F = None
        self.o: G = None
        self.x: B = None
        self.v: C = None
        self.u: H = None
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: B = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: E = None
        self.u: H = None
        self.y: A = None
        self.x: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: G = None
        self.p: C = None
        self.v: E = None
        self.txt = txt

g = A("g")
d = B("d")
e = C("e")
k = D("k")
j = E("j")
f = F("f")
m = G("m")
l = H("l")

g.q = f
g.t = f
g.o = m
g.x = d
g.v = e
g.u = l
g.r = k
d.s = g
e.q = f
e.r = d
e.u = l
k.s = e
k.o = l
j.s = m
j.w = g
f.t = k
f.v = j
f.u = l
f.y = g
f.x = m
m.v = f
m.u = f
l.y = j
l.v = j
l.z = m
l.p = e
assert k.o.z.v.txt == "f"