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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: F = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: B = None
        self.r: B = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: F = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: B = None
        self.r: B = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: C = None
        self.txt = txt

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

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

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

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