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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: G = None
        self.z: C = None
        self.y: F = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.s: F = None
        self.x: B = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: F = None
        self.u: E = None
        self.q: D = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: G = None
        self.z: C = None
        self.y: F = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: C = None
        self.s: F = None
        self.x: B = None
        self.r: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: F = None
        self.u: E = None
        self.q: D = None
        self.r: E = None
        self.txt = txt

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

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