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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: B = None
        self.p: B = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: B = None
        self.p: B = None
        self.w: E = None
        self.txt = txt

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

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