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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: G = None
        self.s: C = None
        self.z: F = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.p: G = None
        self.s: C = None
        self.z: F = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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