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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: G = None
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: F = None
        self.v: D = None
        self.z: A = None
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: F = None
        self.u: C = None
        self.s: E = None
        self.y: F = None
        self.txt = txt

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

h.u = b
h.q = b
h.z = a
m.o = e
l.y = n
l.v = b
b.s = l
a.p = b
n.u = e
n.x = g
n.y = b
g.r = l
g.q = n
g.v = b
g.z = h
g.u = a
e.v = a
e.s = a
e.p = n
e.y = n
e.u = l
assert a.p.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: D = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: G = None
        self.y: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: F = None
        self.v: D = None
        self.z: A = None
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: F = None
        self.u: C = None
        self.s: E = None
        self.y: F = None
        self.txt = txt

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

h.u = b
h.q = b
h.z = a
m.o = e
l.y = n
l.v = b
b.s = l
a.p = b
n.u = e
n.x = g
n.y = b
g.r = l
g.q = n
g.v = b
g.z = h
g.u = a
e.v = a
e.s = a
e.p = n
e.y = n
e.u = l
assert a.p.s.y.txt == "n"