class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: G = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: C = None
        self.p: D = None
        self.x: B = None
        self.q: B = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.z: C = None
        self.p: D = None
        self.x: B = None
        self.q: B = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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