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

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: D = None
        self.p: C = None
        self.y: A = None
        self.o: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: G = None
        self.u: B = None
        self.o: G = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

k = A("k")
n = B("n")
c = C("c")
i = D("i")
e = E("e")
d = F("d")
g = G("g")
b = D("b")
f = C("f")

k.t = i
k.s = g
n.y = k
n.p = k
n.z = e
n.x = e
n.w = d
c.r = e
c.q = n
i.z = e
i.s = b
i.o = b
i.p = f
i.y = k
e.y = g
e.w = g
d.v = i
d.p = g
d.o = g
d.u = n
d.t = c
g.v = c
b.z = e
b.s = i
b.o = i
b.p = f
b.y = k
f.r = e
f.q = n
assert b.z.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: D = None
        self.p: C = None
        self.y: A = None
        self.o: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: G = None
        self.u: B = None
        self.o: G = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

k = A("k")
n = B("n")
c = C("c")
i = D("i")
e = E("e")
d = F("d")
g = G("g")
b = D("b")
f = C("f")

k.t = i
k.s = g
n.y = k
n.p = k
n.z = e
n.x = e
n.w = d
c.r = e
c.q = n
i.z = e
i.s = b
i.o = b
i.p = f
i.y = k
e.y = g
e.w = g
d.v = i
d.p = g
d.o = g
d.u = n
d.t = c
g.v = c
b.z = e
b.s = i
b.o = i
b.p = f
b.y = k
f.r = e
f.q = n
assert b.z.w.v.txt == "c"