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

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

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

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

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

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

g = A("g")
k = B("k")
l = C("l")
a = D("a")
i = E("i")
d = F("d")
b = C("b")
h = B("h")
f = F("f")
j = D("j")

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

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

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

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

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

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

g = A("g")
k = B("k")
l = C("l")
a = D("a")
i = E("i")
d = F("d")
b = C("b")
h = B("h")
f = F("f")
j = D("j")

g.s = a
g.y = d
g.p = h
k.r = f
k.t = d
l.p = i
a.s = i
a.r = i
a.u = k
a.x = f
a.q = h
i.v = a
i.s = l
i.o = f
d.s = j
b.p = i
h.r = f
h.t = d
f.s = j
j.s = i
j.r = i
j.u = k
j.x = f
j.q = h
assert b.p.v.q.r.s.r.s.p.o.txt == "f"