class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: E = None
        self.y: G = None
        self.p: D = None
        self.z: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: F = None
        self.q: E = None
        self.s: B = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: F = None
        self.q: E = None
        self.s: B = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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