class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: E = None
        self.u: C = None
        self.t: F = None
        self.r: H = None
        self.o: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: A = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: A = None
        self.u: D = None
        self.o: D = None
        self.q: E = None
        self.p: B = None
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: A = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: A = None
        self.u: D = None
        self.o: D = None
        self.q: E = None
        self.p: B = None
        self.y: A = None
        self.txt = txt

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

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