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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: F = None
        self.o: G = None
        self.r: D = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

j = A("j")
f = B("f")
k = C("k")
c = D("c")
l = E("l")
m = F("m")
e = G("e")

j.w = e
j.o = m
f.u = c
f.r = c
f.x = m
f.z = m
f.o = e
k.p = e
c.t = e
l.r = j
l.p = m
l.x = m
m.s = l
m.q = l
m.v = j
m.x = j
m.z = k
e.v = k
e.z = l
e.u = f
e.p = m
e.o = c
assert f.z.q.r.o.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: F = None
        self.o: G = None
        self.r: D = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

j = A("j")
f = B("f")
k = C("k")
c = D("c")
l = E("l")
m = F("m")
e = G("e")

j.w = e
j.o = m
f.u = c
f.r = c
f.x = m
f.z = m
f.o = e
k.p = e
c.t = e
l.r = j
l.p = m
l.x = m
m.s = l
m.q = l
m.v = j
m.x = j
m.z = k
e.v = k
e.z = l
e.u = f
e.p = m
e.o = c
assert f.z.q.r.o.s.p.txt == "m"