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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: E = None
        self.z: F = None
        self.v: A = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: E = None
        self.z: F = None
        self.v: A = None
        self.o: C = None
        self.txt = txt

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

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

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

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

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

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

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