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

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: A = None
        self.p: A = None
        self.u: F = None
        self.t: B = None
        self.s: F = None
        self.v: C = None
        self.txt = txt

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

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

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

a = A("a")
c = B("c")
l = C("l")
g = D("g")
f = E("f")
h = F("h")
k = G("k")
i = D("i")

a.y = c
c.v = h
c.s = k
c.w = a
l.y = c
l.z = h
l.p = i
g.z = f
g.y = a
g.p = a
g.u = h
g.s = h
g.t = c
g.v = l
f.y = h
h.r = k
h.v = c
k.t = c
k.w = l
i.z = f
i.y = a
i.p = a
i.u = h
i.s = h
i.t = c
i.v = l
assert f.y.v.w.y.v.v.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: A = None
        self.p: A = None
        self.u: F = None
        self.t: B = None
        self.s: F = None
        self.v: C = None
        self.txt = txt

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

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

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

a = A("a")
c = B("c")
l = C("l")
g = D("g")
f = E("f")
h = F("h")
k = G("k")
i = D("i")

a.y = c
c.v = h
c.s = k
c.w = a
l.y = c
l.z = h
l.p = i
g.z = f
g.y = a
g.p = a
g.u = h
g.s = h
g.t = c
g.v = l
f.y = h
h.r = k
h.v = c
k.t = c
k.w = l
i.z = f
i.y = a
i.p = a
i.u = h
i.s = h
i.t = c
i.v = l
assert f.y.v.w.y.v.v.v.r.txt == "k"