class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: A = None
        self.v: F = None
        self.r: B = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

f = A("f")
g = B("g")
l = C("l")
j = D("j")
h = E("h")
b = F("b")
c = C("c")
a = B("a")
e = A("e")

f.o = l
f.y = e
f.v = b
f.r = g
f.p = j
g.p = h
g.y = a
l.y = g
l.q = a
j.p = h
j.t = a
j.o = f
h.s = b
h.u = j
b.p = c
b.w = e
b.r = h
c.y = g
c.q = g
a.p = h
a.y = g
e.o = l
e.y = f
e.v = b
e.r = g
e.p = j
assert g.y.p.s.r.s.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: A = None
        self.v: F = None
        self.r: B = None
        self.p: D = None
        self.txt = txt

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

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

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

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

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

f = A("f")
g = B("g")
l = C("l")
j = D("j")
h = E("h")
b = F("b")
c = C("c")
a = B("a")
e = A("e")

f.o = l
f.y = e
f.v = b
f.r = g
f.p = j
g.p = h
g.y = a
l.y = g
l.q = a
j.p = h
j.t = a
j.o = f
h.s = b
h.u = j
b.p = c
b.w = e
b.r = h
c.y = g
c.q = g
a.p = h
a.y = g
e.o = l
e.y = f
e.v = b
e.r = g
e.p = j
assert g.y.p.s.r.s.w.y.txt == "f"