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

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

j.r = a
j.o = a
j.y = a
j.w = g
j.p = m
j.t = m
h.w = n
a.s = e
a.p = k
n.s = e
n.w = j
k.s = g
k.q = m
k.y = m
k.x = e
k.u = e
k.t = j
g.o = e
g.w = m
e.u = g
m.u = a
assert h.w.s.u.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: F = None
        self.p: H = None
        self.o: C = None
        self.y: C = None
        self.t: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

j.r = a
j.o = a
j.y = a
j.w = g
j.p = m
j.t = m
h.w = n
a.s = e
a.p = k
n.s = e
n.w = j
k.s = g
k.q = m
k.y = m
k.x = e
k.u = e
k.t = j
g.o = e
g.w = m
e.u = g
m.u = a
assert h.w.s.u.o.txt == "e"