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

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: C = None
        self.r: F = None
        self.u: F = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: A = None
        self.u: B = None
        self.z: H = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: C = None
        self.r: F = None
        self.u: F = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: A = None
        self.u: B = None
        self.z: H = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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