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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: F = None
        self.s: F = None
        self.z: B = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: A = None
        self.w: E = None
        self.u: E = None
        self.x: B = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: F = None
        self.s: F = None
        self.z: B = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: A = None
        self.w: E = None
        self.u: E = None
        self.x: B = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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