class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: G = None
        self.s: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: D = None
        self.t: G = None
        self.u: B = None
        self.s: G = None
        self.z: A = None
        self.x: G = None
        self.txt = txt

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

k.z = c
e.q = c
e.o = m
j.w = f
n.p = k
h.y = m
h.v = m
h.s = n
c.o = h
c.q = n
c.s = n
c.p = n
c.x = f
c.z = b
m.r = h
b.r = n
b.o = n
b.t = m
b.s = m
b.x = m
b.u = e
b.z = k
f.w = j
i.z = c
assert j.w.w.w.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.v: G = None
        self.s: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: D = None
        self.t: G = None
        self.u: B = None
        self.s: G = None
        self.z: A = None
        self.x: G = None
        self.txt = txt

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

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