class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: F = None
        self.w: B = None
        self.t: F = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: B = None
        self.y: G = None
        self.x: F = None
        self.p: A = None
        self.v: A = None
        self.q: A = None
        self.txt = txt

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

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

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

f = A("f")
d = B("d")
n = C("n")
h = D("h")
j = E("j")
k = F("k")
a = G("a")
c = A("c")

f.u = h
f.x = h
f.s = k
f.t = k
f.w = d
d.w = k
d.t = a
n.x = a
n.u = k
n.z = j
n.o = f
h.r = k
h.x = k
h.z = d
h.y = a
h.p = c
h.v = c
h.q = f
j.w = h
j.r = k
j.u = k
j.y = d
j.z = f
k.z = h
k.r = n
a.z = c
a.x = c
a.w = j
c.u = h
c.x = h
c.s = k
c.t = k
c.w = d
assert c.u.z.t.w.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: F = None
        self.w: B = None
        self.t: F = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: B = None
        self.y: G = None
        self.x: F = None
        self.p: A = None
        self.v: A = None
        self.q: A = None
        self.txt = txt

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

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

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

f = A("f")
d = B("d")
n = C("n")
h = D("h")
j = E("j")
k = F("k")
a = G("a")
c = A("c")

f.u = h
f.x = h
f.s = k
f.t = k
f.w = d
d.w = k
d.t = a
n.x = a
n.u = k
n.z = j
n.o = f
h.r = k
h.x = k
h.z = d
h.y = a
h.p = c
h.v = c
h.q = f
j.w = h
j.r = k
j.u = k
j.y = d
j.z = f
k.z = h
k.r = n
a.z = c
a.x = c
a.w = j
c.u = h
c.x = h
c.s = k
c.t = k
c.w = d
assert c.u.z.t.w.z.t.txt == "k"