class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: B = None
        self.r: E = None
        self.q: G = None
        self.u: F = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: F = None
        self.q: A = None
        self.t: F = None
        self.x: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: C = None
        self.x: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: F = None
        self.q: A = None
        self.t: F = None
        self.x: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: C = None
        self.x: C = None
        self.txt = txt

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

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