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

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

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: D = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

f = A("f")
e = B("e")
n = C("n")
b = D("b")
i = E("i")
j = F("j")
c = G("c")
d = C("d")
g = D("g")
k = B("k")

f.s = j
e.x = j
e.p = d
e.o = i
n.w = d
b.u = g
b.z = g
b.o = f
i.v = g
i.p = g
i.t = k
j.y = b
j.x = c
c.x = b
d.w = n
g.u = b
g.z = b
g.o = f
k.x = j
k.p = n
k.o = i
assert e.o.t.o.p.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.z: D = None
        self.o: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.x: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

f = A("f")
e = B("e")
n = C("n")
b = D("b")
i = E("i")
j = F("j")
c = G("c")
d = C("d")
g = D("g")
k = B("k")

f.s = j
e.x = j
e.p = d
e.o = i
n.w = d
b.u = g
b.z = g
b.o = f
i.v = g
i.p = g
i.t = k
j.y = b
j.x = c
c.x = b
d.w = n
g.u = b
g.z = b
g.o = f
k.x = j
k.p = n
k.o = i
assert e.o.t.o.p.o.s.txt == "j"