class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: C = None
        self.y: F = None
        self.r: C = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: E = None
        self.u: D = None
        self.y: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: D = None
        self.y: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: E = None
        self.u: D = None
        self.y: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: D = None
        self.y: D = None
        self.txt = txt

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

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

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