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

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: F = None
        self.y: C = None
        self.z: C = None
        self.t: A = None
        self.q: B = None
        self.s: G = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: F = None
        self.y: C = None
        self.z: C = None
        self.t: A = None
        self.q: B = None
        self.s: G = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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