class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: B = None
        self.y: H = None
        self.o: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: D = None
        self.v: E = None
        self.t: I = None
        self.y: H = None
        self.r: G = None
        self.u: D = None
        self.z: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: G = None
        self.x: F = None
        self.p: E = None
        self.txt = txt

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

b = A("b")
f = B("f")
c = C("c")
k = D("k")
n = E("n")
e = F("e")
m = G("m")
a = H("a")
h = I("h")
d = B("d")

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.x: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: D = None
        self.v: E = None
        self.t: I = None
        self.y: H = None
        self.r: G = None
        self.u: D = None
        self.z: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: G = None
        self.x: F = None
        self.p: E = None
        self.txt = txt

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

b = A("b")
f = B("f")
c = C("c")
k = D("k")
n = E("n")
e = F("e")
m = G("m")
a = H("a")
h = I("h")
d = B("d")

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