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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: G = None
        self.r: A = None
        self.t: C = None
        self.q: G = None
        self.z: D = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: H = None
        self.z: G = None
        self.p: B = None
        self.r: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: F = None
        self.o: F = None
        self.u: H = None
        self.y: C = None
        self.v: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: G = None
        self.r: A = None
        self.t: C = None
        self.q: G = None
        self.z: D = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: H = None
        self.z: G = None
        self.p: B = None
        self.r: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: F = None
        self.o: F = None
        self.u: H = None
        self.y: C = None
        self.v: C = None
        self.txt = txt

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

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

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