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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: E = None
        self.x: E = None
        self.u: A = None
        self.o: E = None
        self.w: E = None
        self.y: C = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: C = None
        self.p: B = None
        self.w: E = None
        self.t: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: E = None
        self.x: E = None
        self.u: A = None
        self.o: E = None
        self.w: E = None
        self.y: C = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: C = None
        self.p: B = None
        self.w: E = None
        self.t: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: A = None
        self.txt = txt

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

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