class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: D = None
        self.q: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: D = None
        self.t: C = None
        self.y: A = None
        self.p: D = None
        self.s: F = None
        self.txt = txt

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

h = A("h")
k = B("k")
j = C("j")
a = D("a")
b = E("b")
g = F("g")
i = E("i")
m = E("m")

h.r = i
h.q = i
h.w = a
k.u = j
k.x = j
j.u = a
j.q = k
j.v = i
a.t = j
b.w = h
b.y = h
b.q = a
b.p = a
b.t = j
b.s = g
g.z = h
g.q = h
g.r = h
g.p = k
g.w = k
i.w = h
i.y = h
i.q = a
i.p = a
i.t = j
i.s = g
m.w = h
m.y = h
m.q = a
m.p = a
m.t = j
m.s = g
assert g.w.u.v.t.v.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: D = None
        self.q: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: D = None
        self.t: C = None
        self.y: A = None
        self.p: D = None
        self.s: F = None
        self.txt = txt

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

h = A("h")
k = B("k")
j = C("j")
a = D("a")
b = E("b")
g = F("g")
i = E("i")
m = E("m")

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