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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: G = None
        self.z: H = None
        self.r: G = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: G = None
        self.p: F = None
        self.u: D = None
        self.txt = txt

d = A("d")
g = B("g")
j = C("j")
i = D("i")
k = E("k")
f = F("f")
c = G("c")
a = H("a")

d.t = f
d.q = f
g.p = k
g.x = c
g.r = c
g.z = a
g.y = d
j.x = a
j.w = c
j.o = f
j.s = i
j.p = g
i.s = k
i.t = j
i.z = j
i.v = j
i.w = f
i.p = f
k.q = j
k.v = j
k.r = d
k.w = i
f.y = g
f.r = i
f.p = k
f.o = c
f.q = a
f.v = a
c.s = g
c.q = g
c.y = g
c.t = d
c.v = d
c.p = i
c.w = j
a.w = f
a.p = f
a.o = c
a.u = i
assert f.o.t.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: G = None
        self.z: H = None
        self.r: G = None
        self.y: A = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: G = None
        self.p: F = None
        self.u: D = None
        self.txt = txt

d = A("d")
g = B("g")
j = C("j")
i = D("i")
k = E("k")
f = F("f")
c = G("c")
a = H("a")

d.t = f
d.q = f
g.p = k
g.x = c
g.r = c
g.z = a
g.y = d
j.x = a
j.w = c
j.o = f
j.s = i
j.p = g
i.s = k
i.t = j
i.z = j
i.v = j
i.w = f
i.p = f
k.q = j
k.v = j
k.r = d
k.w = i
f.y = g
f.r = i
f.p = k
f.o = c
f.q = a
f.v = a
c.s = g
c.q = g
c.y = g
c.t = d
c.v = d
c.p = i
c.w = j
a.w = f
a.p = f
a.o = c
a.u = i
assert f.o.t.t.q.txt == "a"