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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: B = None
        self.u: G = None
        self.w: G = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: D = None
        self.y: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: B = None
        self.u: B = None
        self.txt = txt

i = A("i")
l = B("l")
n = C("n")
d = D("d")
f = E("f")
j = F("j")
c = G("c")
e = B("e")

i.s = f
i.r = j
l.r = d
l.q = e
l.u = c
l.w = c
l.z = j
n.z = d
n.p = d
n.y = j
d.p = i
d.s = f
f.p = j
f.o = c
f.y = c
f.s = i
f.q = i
j.z = i
j.y = f
c.q = n
c.s = l
c.u = e
e.r = d
e.q = l
e.u = c
e.w = c
e.z = j
assert l.q.z.y.p.y.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: B = None
        self.u: G = None
        self.w: G = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: D = None
        self.y: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: B = None
        self.u: B = None
        self.txt = txt

i = A("i")
l = B("l")
n = C("n")
d = D("d")
f = E("f")
j = F("j")
c = G("c")
e = B("e")

i.s = f
i.r = j
l.r = d
l.q = e
l.u = c
l.w = c
l.z = j
n.z = d
n.p = d
n.y = j
d.p = i
d.s = f
f.p = j
f.o = c
f.y = c
f.s = i
f.q = i
j.z = i
j.y = f
c.q = n
c.s = l
c.u = e
e.r = d
e.q = l
e.u = c
e.w = c
e.z = j
assert l.q.z.y.p.y.p.z.txt == "i"