class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: F = None
        self.y: G = None
        self.v: D = None
        self.q: E = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: E = None
        self.s: F = None
        self.y: G = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: E = None
        self.t: G = None
        self.v: B = None
        self.r: G = None
        self.txt = txt

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

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

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

g = A("g")
a = B("a")
h = C("h")
c = D("c")
j = E("j")
l = F("l")
n = G("n")

g.r = j
g.q = j
g.s = l
g.y = n
g.v = c
g.p = a
a.r = c
h.z = a
h.t = j
h.s = l
h.x = l
h.y = n
c.q = j
c.y = j
c.t = n
c.r = n
c.v = a
j.y = n
j.o = n
l.s = j
n.w = c
n.s = j
n.r = j
assert j.o.w.r.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: F = None
        self.y: G = None
        self.v: D = None
        self.q: E = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: E = None
        self.s: F = None
        self.y: G = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: E = None
        self.t: G = None
        self.v: B = None
        self.r: G = None
        self.txt = txt

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

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

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

g = A("g")
a = B("a")
h = C("h")
c = D("c")
j = E("j")
l = F("l")
n = G("n")

g.r = j
g.q = j
g.s = l
g.y = n
g.v = c
g.p = a
a.r = c
h.z = a
h.t = j
h.s = l
h.x = l
h.y = n
c.q = j
c.y = j
c.t = n
c.r = n
c.v = a
j.y = n
j.o = n
l.s = j
n.w = c
n.s = j
n.r = j
assert j.o.w.r.s.txt == "j"