class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: B = None
        self.w: C = None
        self.p: E = None
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: D = None
        self.s: G = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: E = None
        self.y: H = None
        self.s: D = None
        self.t: D = None
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: H = None
        self.o: H = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: H = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: G = None
        self.p: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: D = None
        self.s: G = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: E = None
        self.y: H = None
        self.s: D = None
        self.t: D = None
        self.w: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: H = None
        self.o: H = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: H = None
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: G = None
        self.p: F = None
        self.txt = txt

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

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