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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: E = None
        self.q: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: A = None
        self.w: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: E = None
        self.q: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: A = None
        self.w: C = None
        self.txt = txt

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

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

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