class A:
    def __init__(self, txt: str):
        self.o: H = None
        self.y: G = None
        self.u: B = None
        self.p: G = None
        self.z: B = None
        self.v: H = None
        self.r: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: B = None
        self.o: D = None
        self.p: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: H = None
        self.v: F = None
        self.w: H = None
        self.p: D = None
        self.o: D = None
        self.s: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: B = None
        self.o: D = None
        self.p: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.y: H = None
        self.v: F = None
        self.w: H = None
        self.p: D = None
        self.o: D = None
        self.s: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: E = None
        self.txt = txt

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

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