class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: G = None
        self.s: E = None
        self.t: G = None
        self.u: D = None
        self.y: E = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: E = None
        self.p: D = None
        self.w: G = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: E = None
        self.p: D = None
        self.w: G = None
        self.o: G = None
        self.txt = txt

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

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

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