class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: F = None
        self.u: F = None
        self.z: C = None
        self.t: B = None
        self.v: C = None
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: E = None
        self.t: B = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: C = None
        self.p: D = None
        self.y: A = None
        self.r: D = None
        self.x: C = None
        self.v: B = None
        self.o: E = None
        self.txt = txt

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

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

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

f = A("f")
k = B("k")
e = C("e")
i = D("i")
a = E("a")
h = F("h")
m = G("m")
b = H("b")
g = E("g")

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: E = None
        self.t: B = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: C = None
        self.p: D = None
        self.y: A = None
        self.r: D = None
        self.x: C = None
        self.v: B = None
        self.o: E = None
        self.txt = txt

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

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

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

f = A("f")
k = B("k")
e = C("e")
i = D("i")
a = E("a")
h = F("h")
m = G("m")
b = H("b")
g = E("g")

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