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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: C = None
        self.y: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: C = None
        self.y: D = None
        self.txt = txt

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

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