class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: D = None
        self.p: H = None
        self.r: F = None
        self.y: H = None
        self.s: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: G = None
        self.s: A = None
        self.p: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: B = None
        self.o: B = None
        self.z: D = None
        self.p: C = None
        self.v: B = None
        self.w: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: G = None
        self.s: A = None
        self.p: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: B = None
        self.o: B = None
        self.z: D = None
        self.p: C = None
        self.v: B = None
        self.w: H = None
        self.txt = txt

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

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

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