class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: F = None
        self.t: D = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: D = None
        self.r: E = None
        self.o: E = None
        self.y: B = None
        self.v: B = None
        self.t: F = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: D = None
        self.r: E = None
        self.o: E = None
        self.y: B = None
        self.v: B = None
        self.t: F = None
        self.txt = txt

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

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