class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: G = None
        self.p: G = None
        self.v: C = None
        self.x: G = None
        self.w: C = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: D = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: A = None
        self.t: G = None
        self.x: A = None
        self.w: C = None
        self.z: A = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: G = None
        self.p: B = None
        self.x: D = None
        self.v: D = None
        self.txt = txt

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

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

k = A("k")
f = B("f")
l = C("l")
d = D("d")
h = E("h")
b = F("b")
m = G("m")

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: D = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.r: A = None
        self.t: G = None
        self.x: A = None
        self.w: C = None
        self.z: A = None
        self.p: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: G = None
        self.p: B = None
        self.x: D = None
        self.v: D = None
        self.txt = txt

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

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

k = A("k")
f = B("f")
l = C("l")
d = D("d")
h = E("h")
b = F("b")
m = G("m")

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