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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: D = None
        self.t: C = None
        self.s: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: A = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

j = A("j")
d = B("d")
k = C("k")
m = D("m")
g = E("g")
h = F("h")
f = G("f")
e = F("e")
a = C("a")
c = A("c")

j.x = c
j.u = k
d.p = f
d.s = f
d.o = m
d.t = a
k.u = f
m.o = d
m.y = e
g.r = j
g.y = j
g.u = e
h.o = f
f.w = m
f.s = j
f.p = h
e.o = f
a.u = f
c.x = j
c.u = a
assert e.o.s.u.u.s.u.u.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: D = None
        self.t: C = None
        self.s: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: A = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.txt = txt

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

j = A("j")
d = B("d")
k = C("k")
m = D("m")
g = E("g")
h = F("h")
f = G("f")
e = F("e")
a = C("a")
c = A("c")

j.x = c
j.u = k
d.p = f
d.s = f
d.o = m
d.t = a
k.u = f
m.o = d
m.y = e
g.r = j
g.y = j
g.u = e
h.o = f
f.w = m
f.s = j
f.p = h
e.o = f
a.u = f
c.x = j
c.u = a
assert e.o.s.u.u.s.u.u.p.o.txt == "f"