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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: E = None
        self.v: E = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: E = None
        self.p: E = None
        self.o: E = None
        self.r: E = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: G = None
        self.w: F = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: B = None
        self.o: D = None
        self.w: A = None
        self.q: E = None
        self.v: B = None
        self.txt = txt

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

c = A("c")
f = B("f")
j = C("j")
i = D("i")
h = E("h")
a = F("a")
b = G("b")
g = G("g")
d = A("d")

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: E = None
        self.v: E = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: E = None
        self.p: E = None
        self.o: E = None
        self.r: E = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: G = None
        self.w: F = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: B = None
        self.o: D = None
        self.w: A = None
        self.q: E = None
        self.v: B = None
        self.txt = txt

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

c = A("c")
f = B("f")
j = C("j")
i = D("i")
h = E("h")
a = F("a")
b = G("b")
g = G("g")
d = A("d")

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